home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fatted Calf
/
The Fatted Calf.iso
/
Modules
/
BackSpaceModules
/
Source
/
MazeView
/
MazeView.h
< prev
next >
Wrap
Text File
|
1994-01-12
|
2KB
|
108 lines
#import <appkit/appkit.h>
#import "Thinker.h"
#define ITERATIONS 20000/* max # of iterations before restarting */
#define PANELTIME 333 /* ms delay between *panel* animation frames */
#define MINCELLSIZE 2 /* Make sure cell size gets no smaller than... */
#define MAXDELAY 1000 /* no more than this many ms between frames */
#define RECTBUFSIZE 32 /* Number of squares of one color to draw at once */
#define MAXCOLS (1600/MINCELLSIZE+2) /* full screen of smallest cells (x) */
#define MAXROWS (1280/MINCELLSIZE+2) /* (y) */
typedef struct _mazecell {
int next;
int bdir;
unsigned int eastwall : 1;
unsigned int northwall : 1;
unsigned int westwall : 1;
unsigned int southwall : 1;
} mazecell;
@interface MazeView:View
{
mazecell *Grid;
BStimeval lasttime;
int icur;
int dcur;
int ncols, nrows;
int countDown;
int ifirst;
int cellSize;
int wallSize;
int pathSize;
int gapSize;
int xoffset, yoffset;
BOOL randomColor;
NXColor wallColor;
NXColor curWallColor;
NXColor pathColor;
NXColor curPathColor;
int delay;
NXRect wallRectList[RECTBUFSIZE];
int wallRectListSize;
NXRect pathRectList[RECTBUFSIZE];
int pathRectListSize;
NXRect eraseRectList[RECTBUFSIZE];
int eraseRectListSize;
id panelSpeedSlider;
id randomColorSwitch;
id sharedInspectorPanel;
id panelWallColorWell;
id panelPathColorWell;
id panelMazeView;
id panelCreditsView;
}
- oneStep;
- drawForward:(int)index;
- drawBack:(int)index;
- drawSelf:(const NXRect *)rects :(int)rectCount;
- (const char *) windowTitle;
- initFrame:(const NXRect *)frameRect;
- free;
- getMazeDefaults;
- sizeTo:(NXCoord)width :(NXCoord)height;
- initMaze;
- computeMaze;
- firstStep;
- clearMaze;
- addWallRectOrigin:(int) x :(int) y size:(int)w :(int) h;
- flushWallRects;
- addPathRectOrigin:(int) x :(int) y size:(int)w :(int) h;
- flushPathRects;
- addEraseRectOrigin:(int) x :(int) y size:(int)w :(int) h;
- flushEraseRects;
- flushDrawing;
- updateViews;
- inspector:sender;
- inspectorInstalled;
- doSpeedSlider:sender;
- doRandomColorSwitch:sender;
- takeWallColorFrom:sender;
- takePathColorFrom:sender;
- showCredits:sender;
- hideCredits:sender;
- doShowCredits:sender;
- doHideCredits:sender;
@end
@interface StaticMazeView:MazeView
{
}
- setWallColor:(NXColor)wc pathColor:(NXColor)pc;
@end